import request from '@/utils/request'
import type { HomeData } from '@/types/home'

// 获取首页数据
export const getHomeData = () => {
  return request.get<{
    code: number
    data: HomeData
    message: string
  }>('/home')
}

// 获取首页轮播图
export const getHomeBanners = () => {
  return request.get<{
    code: number
    data: {
      items: HomeData['banners']
    }
    message: string
  }>('/home/banners')
}

// 获取首页精选样片
export const getHomeFeaturedSamples = () => {
  return request.get<{
    code: number
    data: {
      items: HomeData['samples']
    }
    message: string
  }>('/home/featured-samples')
}

// 获取首页推荐摄影师
export const getHomeFeaturedPhotographers = () => {
  return request.get<{
    code: number
    data: {
      items: HomeData['photographers']
    }
    message: string
  }>('/home/featured-photographers')
}
